package com.example.doctor.jpa;

import com.example.common.entity.Answer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AnswerRepository extends JpaRepository<Answer,Long> {
    @Query(value = "SELECT * FROM order_answer WHERE qid_bigint=?1",nativeQuery = true)
    List<Answer> findByQid(Long qid);

    
    @Query(value = "SELECT * FROM order_answer WHERE fid_bigint=?1 and qid_bigint = ?2",nativeQuery = true)
    List<Answer> findByFid(Long fid, Long qid);
}
